#ifndef PHOTO_H
#define PHOTO_H

#include <QWidget>
#include <QDebug>
#include <QPaintEvent>
#include <QTimer>
#include <QProcess>
#include <QKeyEvent>
#include <QMouseEvent>
#include <QEvent>

#include "keythread.h"
#include "loading.h"


class Photo : public QWidget
{
    Q_OBJECT
public:
    explicit Photo(QWidget *parent = nullptr);
    ~Photo();

    void paintEvent(QPaintEvent *event) override;

    QStringList list;
    bool isloading = true;
    Loading *loading;
    int index = 0;
    qreal scale = 1.0;
    QTimer timer;

    void keyPressEvent(QKeyEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    bool event(QEvent *event) override;
private slots:
    void KeyEvent(Key_t, int);
signals:
    void finishLoad();
    void sigClose();
};

#endif // PHOTO_H
